home *** CD-ROM | disk | FTP | other *** search
/ Freaks Macintosh Archive / Freaks Macintosh Archive.bin / Essentials / ResEdit 2.1.3.sea / ResEdit 2.1.3 / Examples / Libraries / RSSC.a < prev    next >
Text File  |  1994-07-15  |  3KB  |  96 lines

  1. ;
  2. ; COPYRIGHT (C) 1984-1990 Apple Computer,Inc.
  3. ; All rights reserved
  4.  
  5. ; This is the standard interface for a Resource Standard Code segment for use
  6. ; by the resource editor.  The main resource editor will dispatch to this code
  7. ; when the user opens the respective type for editing.  Dispatches will also
  8. ; occur with menu commands and events for this window.  This code should be
  9. ; included in the resource editor file under type RSSC with any unique ID.  It's
  10. ; resource name should consist of the type it's willing to edit or 'ALL' if it
  11. ; can edit all types of resources. {This comment is too old...}
  12.  
  13. ; Each code segment MUST have a window and its kind MUST be the ID of the code and
  14. ; the refcon usually contains the handle to the instance of the object who's
  15. ; owned by the code.  On activate/deactivate events, the code can put up and
  16. ; remove any menus if desired.
  17.  
  18. ; The standard routines are:
  19.  
  20.  
  21. ;        EditBirth( thing:Handle; parent: ParentHandle );
  22.  
  23. ;        PickBirth( t: ResType; parent: ParentHandle );
  24.  
  25. ;        DoMenu( menu, item: INTEGER; object: Handle );
  26.  
  27. ;        DoEvent( VAR evt: EvtRecord; object: Handle );
  28.  
  29.  
  30.  
  31.             BLANKS      ON
  32.             STRING      ASIS
  33.  
  34.         INCLUDE    'Traps.a'
  35.  
  36. StdRSSC      MAIN
  37.  
  38. ; Implemented in pascal for now...
  39.  
  40.             IMPORT      PickBirth
  41.             IMPORT      EditBirth
  42.             IMPORT      DoEvent
  43.             IMPORT      DoMenu
  44.             IMPORT      DoInfoUpdate
  45.         IMPORT    IsThisYours
  46.             EXPORT      ResEdID
  47.  
  48. StdHeader
  49.             DC.L        ('RSSC')
  50.  
  51.             DC.W        JEditBirth-StdHeader
  52.             DC.W        JPickBirth-StdHeader
  53.             DC.W        JDoEvent-StdHeader
  54.             DC.W        JDoMenu-StdHeader
  55.             DC.W        JDoInfoUpdate-StdHeader
  56.             DC.W        JIsThisYours-StdHeader
  57.             DC.W        0
  58.             DC.W        0
  59.             DC.W        0
  60. JEditBirth
  61. ; someday search for a window which satisfies this request
  62.             JMP            EditBirth
  63. JPickBirth
  64.             JMP            PickBirth
  65. JDoEvent
  66.             JMP            DoEvent
  67. JDoMenu
  68.             JMP            DoMenu
  69. JDoInfoUpdate
  70.             JMP            DoInfoUpdate
  71. JIsThisYours
  72.         JMP        IsThisYours
  73.  
  74.  
  75. ; Gets Res ID of self and returns it
  76. ;        FUNCTION ResEdID: INTEGER;
  77.  
  78. ResEdID
  79.             LINK        A6,#-256
  80.  
  81.             LEA            StdHeader,A0
  82.             _RecoverHandle
  83.  
  84.             MOVE.L      A0,-(SP)            ; pass handle
  85.             PEA            8(A6)                ; function result
  86.             PEA            -256(A6)            ; ignore type
  87.             MOVE.L      (SP),-(SP)            ; ignore name
  88.             _GetResInfo
  89.  
  90.             UNLK        A6
  91.  
  92.             RTS
  93.  
  94.             END 
  95.  
  96.